class CreatePosts < ActiveRecord::Migration
  def self.up
    create_table :posts do |t|
			t.string 	:title, :null=>false
			t.integer :category_id
			t.text		:content
			t.integer :user_id
			t.string	:slug, :null=>false
			t.boolean :is_visible, :default=>true		
      t.timestamps
    end
    
    add_index :posts, [:user_id], :name=>"fk_user"
  end

  def self.down
    drop_table :posts
  end
end
